package com.bobo.web.provider.controller.web;

import com.bobo.web.api.domain.transferRecord.TransferRecord;
import com.bobo.web.api.vo.base.ResponseResult;
import com.bobo.web.provider.dao.transferRecord.TransferRecordMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("web/transfer")
public class TransferRecordController {
    private static Logger LOGGER = LoggerFactory.getLogger(TransferRecordController.class);
    @Resource
    private TransferRecordMapper transferRecordMapper;

    /**
     *
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/save", method = {RequestMethod.POST})
    public ResponseResult<String> save(@RequestBody TransferRecord transferRecord) throws Exception {
        ResponseResult<String> result = new ResponseResult<>();
        transferRecordMapper.insertSelective(transferRecord);
        result.setMessage("OK");
        return result;
    }
    /**
     *
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/getList", method = {RequestMethod.GET})
    public String getList(Model model) throws Exception {
        TransferRecord transferRecord = new TransferRecord();
        List<TransferRecord> transferRecords = transferRecordMapper.selectTransferRecordList(transferRecord);
        return "springCloud";
    }
}
